<?php

class PageModel {
	private $config;
	private $db;
	
	public function __construct(&$config) {
		$this->config = $config;
		$this->db = $this->config->db;
	}
	
	public function getPage($page) {
		$page = $this->db->real_escape_string($page);
		$result = $this->db->query("SELECT * FROM pages WHERE request = '".$page."'");
		$row = $result->fetch_assoc();

		$this->config->page->loadController($row['controller']);
	}
}

?>